//引入api接口
import request from '@/utils/request'
import type { GetInfo, LonOut, loginForm, loginRepData } from './type'

//统一管理接口
//项目用户相关的请求地址
enum API {
  LOGIN_URL = '/admin/acl/index/login',
  USERINFO_URL = '/admin/acl/index/info',
  LOGOUT_URL = '/admin/acl/index/logout',
}

//登录接口方法
export const reqLonin = (data: loginForm) =>
  request.post<loginRepData>(API.LOGIN_URL, data)
//获取用户信
export const reqInfo = () => request.get<GetInfo>(API.USERINFO_URL)
//退出登录
export const reqLonOut = () => request.post<LonOut>(API.LOGOUT_URL)
